package com.cy.store.controller.session;

import javax.servlet.http.HttpSession;

public class UserSession {
    public static final Integer getUIdBySession(HttpSession httpSession){
        //getAttribute返回的是Object对象,需要转换为字符串再转换为包装类
        return Integer.valueOf(httpSession.getAttribute("uid").toString());
    }

    public static final String getUsernameBySession(HttpSession httpSession){
        return httpSession.getAttribute("username").toString();
    }
}
